package cn.ysl.management.model;

public class Admin extends BaseUserEntity {
    private Integer aid;
    private String AdminName;
    private String password;
    private String salt;
    private String avatar;

    public Integer getAid() {
        return aid;
    }

    public void setAid(Integer aid) {
        this.aid = aid;
    }

    public String getAdminName() {
        return AdminName;
    }

    public void setAdminName(String adminName) {
        AdminName = adminName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Admin)) return false;
        if (!super.equals(o)) return false;

        Admin admin = (Admin) o;

        if (getAid() != null ? !getAid().equals(admin.getAid()) : admin.getAid() != null) return false;
        if (getAdminName() != null ? !getAdminName().equals(admin.getAdminName()) : admin.getAdminName() != null)
            return false;
        if (getPassword() != null ? !getPassword().equals(admin.getPassword()) : admin.getPassword() != null)
            return false;
        if (getSalt() != null ? !getSalt().equals(admin.getSalt()) : admin.getSalt() != null) return false;
        return getAvatar() != null ? getAvatar().equals(admin.getAvatar()) : admin.getAvatar() == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (getAid() != null ? getAid().hashCode() : 0);
        result = 31 * result + (getAdminName() != null ? getAdminName().hashCode() : 0);
        result = 31 * result + (getPassword() != null ? getPassword().hashCode() : 0);
        result = 31 * result + (getSalt() != null ? getSalt().hashCode() : 0);
        result = 31 * result + (getAvatar() != null ? getAvatar().hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "aid=" + aid +
                ", AdminName='" + AdminName + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", avatar='" + avatar + '\'' +
                "} " + super.toString();
    }
}
